4.2 Item Selection Statements"Teacher, did I pass the level four exam?" ”If the teacher is asked this question, how will he answer? Yes, he will choose different answers according to different conditions:If the test result is greater than or equal
4.2 Item Selection Statements"Teacher, did I pass the level four exam?" ”If the teacher is asked this question, how will he answer? Yes, he will choose different answers according to different conditions:If the test result is greater than or equal
Conditional statement, which is a kind of statement that chooses to execute according to the condition in the program, the difficulty lies in how to abstract the condition accurately in the actual use of such statement. For example, to implement the
If/else statementsConditional statements actually in the previous article we have used several times, here we need to re-grand to introduce it, conditional statements are judged by one or more statements of the return result (true or false) to
Core tips: JavaScript Conditional Statement If ... Else
When you write code, you often need to perform different behaviors according to different conditions. You can use conditional statements in your code to accomplish this task.
In JavaScript,
1. If
The IF structure is one of the most important features in many languages, including PHP, which allows code snippets to be executed on a conditional basis. The IF structure of PHP is similar to the C language:
if (expr)Statement
As defined in
Example:If a For conditional statements, the following points need to be noted:? Conditional statements do not need parentheses to enclose conditions ();? The curly braces {} must exist regardless of the statement body.? The left curly brace {must
The if...else of the Java conditional statementThe operation of the If...else statement is one step more than an if statement: when the condition is true, the code block of the if part is executed, and if the condition is not true, the else part is
Conditional judgment can be divided into:Single-branch judgment: only one if statementTwo-branch judgment: if Else's formatMulti-Branch judgment: if elif else formatConditional statement nesting judgment#Here's a conditional multi-branch judgment
In php, if else or switch statements are used most frequently, next, I will give you a detailed introduction to my notes on using the if else Conditional Control statement in php. if you need it, please refer to it.
In php, the basic process control
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.